// pages/my/qrcode/setmoney.js
const App = getApp()

Page({
  data: {
    show: !0,
    form: {
      name: '',
      is_def: !1,
    },
  },
  onLoad() {
    this.WxValidate = App.WxValidate({
      name: {
        required: true,
        minlength: 1,
        maxlength: 10,
      },
    }, {
        name: {
          required: '请输入金额',
        },
      })

    this.address = App.HttpResource('/address/:id', { id: '@id' })
  },


  submitForm(e) {
    const params = e.detail.value

    console.log(params)

    if (!this.WxValidate.checkForm(e)) {
      const error = this.WxValidate.errorList[0]
      App.WxService.showModal({
        title: '友情提示',
        content: `${error.msg}`,
        showCancel: !1,
      })
      return false
    }

    console.log(e)
    App.WxService.navigateTo('/pages/my/qrcode/newcode')



  },
  showToast(message) {
    App.WxService.showToast({
      title: message,
      icon: 'success',
      duration: 1500,
    })
      .then(() => App.WxService.navigateBack())
  },
  chooseLocation() {
    App.WxService.chooseLocation()
      .then(data => {
        console.log(data)
        this.setData({
          'form.address': data.address
        })
      })
  },


  
  toIndex(e) {
    console.log(e)
    //App.WxService.navigateTo('/pages/index/index')
    wx.switchTab({
      url: '/pages/index/index'
    }) 
  }


})